package PTA.javaA;

import java.util.Arrays;
import java.util.Scanner;

public class ex14 {
    public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Rectangle s[] = new Rectangle[2];
Circle c[] = new Circle[2];
for(int i=0;i<s.length;i++){int width = sc.nextInt();
    int length = sc.nextInt();

    s[i]=new Rectangle(width,length);
}
for(int j=0;j<c.length;j++){
    int radius = sc.nextInt();
    c[j] = new Circle(radius);
}
        System.out.println(s[0].getPerimeter()+s[1].getPerimeter()+c[0].getPerimeter()+c[1].getPerimeter());
        System.out.println(s[0].getArea()+s[1].getArea()+c[0].getArea()+c[1].getArea());
        System.out.println(Arrays.deepToString(s));
        System.out.println(Arrays.deepToString(c));
    }

}
class Rectangle{
    private int width;
    private int length;

    public Rectangle() {
    }

    public Rectangle(int width, int length) {
        this.width = width;
        this.length = length;
    }

    public int getPerimeter(){
        return (width+length)*2;
    }
    public int getArea(){
        return width*length;
    }

    @Override
    public String toString() {
        return "Rectangle [width=" + width + ", length=" + length + "]";
    }
}
class Circle{

    private int radius;

    public Circle(int radius) {
        this.radius = radius;
    }

    public Circle() {
    }
    public int getArea(){
        return (int)(Math.PI*radius*radius);
    }
    public int getPerimeter(){
        return (int) (2*Math.PI*radius);
    }

    @Override
    public String toString() {
        return "Circle [" + "radius=" + radius + ']';
    }
}
